package com.wva.video.domain.po;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * <p>
 * 
 * </p>
 *
 * @author hong
 * @since 2025-02-18
 */
@Data
@Accessors(chain = true)
@TableName("video_tag")
@ApiModel(value="VideoTag对象", description="")
public class VideoTag implements Serializable {
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    public VideoTag(String name) {
        this.name = name;
    }

    @ApiModelProperty(value = "视频标签名称")
    private String name;

    @ApiModelProperty(value = "创建用户")
    @TableField(fill = FieldFill.INSERT)
    private Long createBy;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.UPDATE)
    private Long updateBy;

    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "备注")
    private String remark;

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        VideoTag videoTag = (VideoTag) object;
        return Objects.equals(name, videoTag.name);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(name);
    }
}
